package com.yazi.mxz.person.jackson.filter;

import java.util.HashSet;
import java.util.Set;

import com.fasterxml.jackson.databind.ser.FilterProvider;
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
import com.yazi.mxz.common.entity.beans.Member;
import com.yazi.mxz.common.entity.beans.MemberVip;

public abstract class MemberVipFilter {

	public static FilterProvider getWithMember() {
		final Set<String> vip = new HashSet<String>();
		vip.add("addTime");
		vip.add("balance");
		vip.add("checkCode");
		vip.add("id");
		vip.add("member");
		vip.add("status");
		vip.add("updateTime");
		final Set<String> member = new HashSet<String>();
		member.add("balance");
		member.add("integral");
		member.add("memberId");
		member.add("mobile");
		member.add("name");
		member.add("realName");

		return new SimpleFilterProvider()
				.addFilter(MemberVip.class.getSimpleName(),
						SimpleBeanPropertyFilter.filterOutAllExcept(vip))
				.addFilter(Member.class.getSimpleName(),
						SimpleBeanPropertyFilter.filterOutAllExcept(member));
	}

}
